package cn.zhiquxing.test;

import java.util.concurrent.Callable;

public class NotSafePetStore {
    
    private static NoSafeDataBuffer<IGood> noSafeDataBuffer = new NoSafeDataBuffer<>();
    
    static Callable<IGood> productAction = () -> {
        IGood good = new Good();
        try {
            noSafeDataBuffer.addElement(good);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return good;
    };
    
    static Callable<IGood> consumeAction = ()-> {
        IGood good = null;
        try {
            good = noSafeDataBuffer.fetchElement();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return good;
    };
}
